package com.throwable;
import java.io.FileNotFoundException;

public class ErrorAndException {
    private void throwError() {
        throw new StackOverflowError();
    }
    private void throwRuntimeException() {
        throw new RuntimeException();
    }
    /**
     * 可检查异常 CheckedException 是编译器必须检查处理的
     * 编译器对他的处理有：
     * 1. try catch
     * 2. 向上抛出
     */
    private void throwCheckedException01() {
        try {
            throw new FileNotFoundException();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }
    private void throwCheckedException02() throws ClassNotFoundException {
        throw new ClassNotFoundException();
    }
}
